/**
 * 
 */
package kernel_gui.gui.generic;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JPanel;

/**
 * @author Yoyo
 *
 */
public class BackGroundPanel extends JPanel {

	  /**
	 * 
	 */
	private static final long serialVersionUID = 6571383477727190292L;
	public Image img;

	  public BackGroundPanel(int width, int height, String relPath) {
		    this.img = new ImageIcon(relPath).getImage();
		    Dimension size = new Dimension(width, height);
		    setPreferredSize(size);
		    setMinimumSize(size);
		    setMaximumSize(size);
		    setSize(size);
		    setLayout(null);
	  }
	  
	  public BackGroundPanel(int width, int height) {
		    this.img = new ImageIcon("images/bg.jpeg").getImage();
		    Dimension size = new Dimension(width, height);
		    setPreferredSize(size);
		    setMinimumSize(size);
		    setMaximumSize(size);
		    setSize(size);
		    setLayout(null);
		  }
	  

	  public void paintComponent(Graphics g) {
	    g.drawImage(img, 0, 0, null);
	  }

	}

